package nullbeans;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.IOException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

public class Main {

    public static void main(String[] args) throws NoSuchPaddingException, InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, InvalidKeySpecException, IOException {

        byte[] fileBytes = NullBeansFileManager.readFile("C:\\Users\\yj\\Desktop\\test\\student_encrypt.csv");
        byte[] resultBytes = null;

//            resultBytes = AESEncryptionManager.encryptData("key", fileBytes);
        resultBytes = AESEncryptionManager.decryptData("key", fileBytes);

        NullBeansFileManager.writeFile("C:\\Users\\yj\\Desktop\\test\\student_decrypt.csv", resultBytes);

    }

}
